package com.report.dto.response;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author summer
 * @date 2024-06-27 9:19
 */
@Data
@SearchBean(tables = "member_rule m",autoMapTo = "m",orderBy = "m.createTime")
public class MemberRuleRes implements Serializable {

    @DbField("m.id")
    private Integer id;

    @DbField("m.name")
    private String name;

    @DbField("m.price")
    private BigDecimal price;

    @DbField("m.vip")
    private Integer vip;

    @DbField("(CASE WHEN  m.vip=0 THEN '永久有效' WHEN m.vip=90 THEN '一季度90天' ELSE '一年365天' END  )")
    private String vipName;

    @DbField("m.reportSearch")
    private Integer reportSearch;

    @DbField("(CASE WHEN m.reportSearch=0 THEN '无限搜索' ELSE '3次搜索' END)")
    private String reportSearchName;

    @DbField("m.download")
    private Integer download;

    @DbField("(CASE WHEN m.download=1 THEN '是' ELSE '否' END )")
    private String downloadName;

    @DbField("m.imageSearch")
    private Integer imageSearch;

    @DbField("(CASE WHEN m.imageSearch=1 THEN '是' ELSE '否' END )")
    private String imageSearchName;

    @DbField("m.readMonth")
    private Integer readMonth;

    @DbField("m.readDay")
    private Integer readDay;

    @DbField("m.downloadMonth")
    private Integer downloadMonth;

    @DbField("m.downloadDay")
    private Integer downloadDay;

    @DbField("m.createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;
}
